import { React } from 'react';
/*
 * @Author: nqx2007 fenglimima334@163.com
 * @Date: 2023-12-04 18:06:03
 * @LastEditors: nqx2007 fenglimima334@163.com
 * @LastEditTime: 2023-12-12 16:33:00
 * @FilePath: /operator-manager/config/routes.ts
 * @Description: 路由配置
 */

export default [
  {
    path: '/',
    component: '@/layouts/index',
    redirect: '/merchant-home',
  },
  {
    path: '/login',
    name: '登录',
    component: './Login',
    layout: false,
  },
  {
    path: '/find',
    name: '找回密码',
    component: './FindPw',
    layout: false,
  },
  {
    name: '首页',
    path: '/merchant-home',
    component: './Home',
    icon: 'AppstoreOutlined',
    access: 'merchant_home',
  },
  {
    name: '优惠券管理',
    path: '/merchant_coupon_manage',
    icon: 'AppstoreOutlined',
    access: 'merchant_coupon_manage',
    routes: [
      {
        path: '/merchant_coupon_manage',
        redirect: '/merchant_coupon_manage/self_list',
      },
      {
        name: '自营优惠券',
        path: '/merchant_coupon_manage/self_list',
        component: './CouponManage/SelfCouponList',
        access: 'merchant_coupon_self',
      },
      {
        name: '代理优惠券',
        path: '/merchant_coupon_manage/agent_list',
        component: './CouponManage/AgentCouponList',
        access: 'merchant_coupon_agent',
      },
      {
        name: '购入优惠券',
        path: '/merchant_coupon_manage/buy_list',
        component: './CouponManage/BuyCouponList',
        access: 'merchant_coupon_buy',
      },
    ],
  },
  {
    name: '订单管理',
    path: '/merchant_order_manage',
    icon: 'AppstoreOutlined',
    access: 'merchant_order_manage',
    routes: [
      {
        path: '/merchant_order_manage',
        redirect: '/merchant_order_manage/list_personal',
      },
      {
        name: '个人订单',
        path: '/merchant_order_manage/list_personal',
        component: './OrderManage/PersonalOrder',
        access: 'merchant_order_personal',
      },
      {
        name: '商家订单',
        path: '/merchant_order_manage/list_sell',
        component: './OrderManage/BusinessOrder',
        access: 'merchant_order_sell',
      },
      {
        name: '购券订单',
        path: '/merchant_order_manage/list_buy',
        component: './OrderManage/BuyOrder',
        access: 'merchant_order_buy',
      }
    ],
  },
  {
    name: '门店管理',
    path: '/merchant_store_manage',
    icon: 'AppstoreOutlined',
    access: 'merchant_store_manage',
    routes: [
      {
        path: '/merchant_store_manage',
        redirect: '/merchant_store_manage/list_service',
      },
      {
        name: '门店服务',
        path: '/merchant_store_manage/list_service',
        component: './StoreManage/StoreService',
        access: 'merchant_store_service',
      },
    ],
  },
  {
    name: '对账管理',
    path: '/merchant_reconciliation_manage',
    icon: 'AppstoreOutlined',
    access: 'merchant_reconciliation_manage',
    routes: [
      {
        path: '/merchant_reconciliation_manage',
        redirect: '/merchant_reconciliation_manage/fund_account',
      },
      {
        name: '资金账户',
        path: '/merchant_reconciliation_manage/fund_account',
        component: './ReconciliationManage/FundAccount',
        access: 'merchant_fund_account',
      },
      {
        name: '佣金收入',
        path: '/merchant_reconciliation_manage/commission_income',
        component: './ReconciliationManage/CommissionIncome',
        access: 'merchant_commission_income',
      },
    ],
  },
  {
    name: '账号权限',
    path: '/merchant_account_manage',
    icon: 'AppstoreOutlined',
    access: 'merchant_account_manage',
    routes: [
      {
        name: '员工管理',
        path: '/merchant_account_manage/employee_manage',
        component: './AccountAccessManage/EmployeeManage',
        access: 'merchant_list_employee',
      },
      {
        name: '岗位管理',
        path: '/merchant_account_manage/position_manage',
        access: 'merchant_list_position',
        routes: [
          {
            name: '岗位列表',
            component: './AccountAccessManage/PositionManage',
            index: true,
          },
          {
            path: 'position_add',
            name: '岗位添加',
            component: './AccountAccessManage/PositionAdd',
            hideInMenu: true,
          },
          {
            path: 'position_edit/:id',
            name: '岗位编辑',
            component: './AccountAccessManage/PositionEdit',
            hideInMenu: true,
          },
        ],
      },
    ],
  },
];
